Manages the sahders available in the component. More...
Public Member Functions | |
| ~ProgramManager () | |
| Program * | createOrRetrieve (const std::string_view &name) |
| Program * | get (const std::string_view &name) |
| Program * | getByIndex (unsigned int index) |
| void | rename (const std::string_view &oldName, const std::string_view &newName) |
| void | erase (const std::string_view &name) |
| unsigned int | getIdForInputSemantics (Program *program) |
| void | addCustomSemanticIndex (const std::string_view &semanticName, int assignedIndex) |
| int | getCustomSemanticIndex (const std::string_view &semanticName) |
Manages the sahders available in the component.
The manager is responsible for the allocated memory it returns. External code should never delete returned memory.
| nkGraphics::ProgramManager::~ProgramManager | ( | ) |
Destructor.
| Program* nkGraphics::ProgramManager::createOrRetrieve | ( | const std::string_view & | name | ) |
Creates if unavailable, or retrieve if available, a program.
| name | The name of the program to retrieve. |
| Program* nkGraphics::ProgramManager::get | ( | const std::string_view & | name | ) |
Retrieves an existing program.
| name | The name of the program to retrieve. |
| Program* nkGraphics::ProgramManager::getByIndex | ( | unsigned int | index | ) |
Retrieves a program by index. Note that an index can point to different programs as the memory of the manager is changed. Useful to loop over all available programs in one go.
| index | The index of the program to retrieve. |
| void nkGraphics::ProgramManager::rename | ( | const std::string_view & | oldName, |
| const std::string_view & | newName | ||
| ) |
Renames a program, changing both its name and the way to find it in the manager.
| oldName | The name of the program to alter. |
| newName | The new name to assign. |
| void nkGraphics::ProgramManager::erase | ( | const std::string_view & | name | ) |
Erases a program and frees its memory.
| name | The name of the program to erase. |
| unsigned int nkGraphics::ProgramManager::getIdForInputSemantics | ( | Program * | program | ) |
Allows to retrieve the id associated to an input semantic of a program.
| program | The program whose input semantic is to inspect. |
| void nkGraphics::ProgramManager::addCustomSemanticIndex | ( | const std::string_view & | semanticName, |
| int | assignedIndex | ||
| ) |
Allows to specify a custom index for semantic tracking.
| semanticName | The semantic name to create. |
| assignedIndex | The index to attach. |
| int nkGraphics::ProgramManager::getCustomSemanticIndex | ( | const std::string_view & | semanticName | ) |
| semanticName | The semantic name. |